import request from "./http";

/**
 * 请求所有图片
 * @param data
 * @returns {AxiosPromise}
 */
export const reqImages = (data) => {
  return request({
    url: 'images/',
    method: 'get',
    params: data
  })
};

/**
 * 请求详情页
 * @param id
 * @param data
 * @returns {AxiosPromise}
 */
export const reqImageDetail = (id, data) => {
  return request({
    url: 'images/detail/'+id,
    method: 'get',
    params: data
  })
}

/**
 * 下载图片
 * @param id
 * @returns {AxiosPromise}
 */
export const reqDownloadImg = (id) => {
  return request({
    url: 'images/download/' + id,
    method: 'get',
  })
}


export const reqDeleteImages = (data) => {
  return request({
    url: 'images/',
    method: 'delete',
    data
  })
}
